/**
 * User: alesj
 * Date: 15.1.2006
 * Time: 15:12:12
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.alesj.blueberry.spring.validation;

import java.util.List;

/**
 * @author <a href="mailto:ales.justin@genera-lynx.com">Ales Justin</a>
 */
public class ValidationChain implements Validator {

    private List<Validator> validators;

    public ValidationResult validate(long timestamp, String number, String message) {
        for(Validator validator : validators) {
            ValidationResult vr = validator.validate(timestamp, number, message);
            if (vr != null) return vr;
        }
        return null;
    }

    public void setValidators(List<Validator> validators) {
        this.validators = validators;
    }

}
